package com.huonan.jb.tools.fileuse.compare;

import cn.hutool.json.JSONConfig;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.util.LinkedHashMap;
import java.util.Map;

public class TmpApp {
    public static void main(String[] args) {
        Map<Object, Object> map = new LinkedHashMap<>();
        map.put(123, 124);
        map.put(1234, null);
        map.put(1235, null);
        JSONConfig jsonConfig = new JSONConfig();
        jsonConfig.setIgnoreNullValue(false);
        JSONObject entries = JSONUtil.parseObj(map,jsonConfig);
        JSONObject obj = JSONUtil.createObj(jsonConfig);
        obj.set("aa",null);
        obj.set("bb",123);
        obj.putOpt("cc",123);
        String entries2 = JSONUtil.toJsonStr(obj);
        System.out.println(entries);
        System.out.println(entries2);
    }
}
